package io;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {

        FileInputStream file = new FileInputStream("abc.zip");

        FileOutputStream fos = new FileOutputStream("abcdef.zip");

        int d;//用来保存每次读取到的字节内容

        long begintime = System.currentTimeMillis();
        while ((d = file.read()) != -1){
            fos.write(d);
        }
        long endtinme=System.currentTimeMillis();
        long costTime = (endtinme - begintime);
        System.out.println(costTime);
        System.out.println("xx");
        file.close();
        fos.close();
    }
}
